package com.share.api.order.api;

import com.share.api.order.domain.OrderInfo;
import com.share.api.order.factory.RemoteOrderInfoFallbackFactory;
import com.share.common.core.domain.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import com.share.common.core.constant.ServiceNameConstants;

@FeignClient(contextId = "remoteOrderInfoService", value = ServiceNameConstants.ORDER_SERVICE, fallbackFactory = RemoteOrderInfoFallbackFactory.class)
public interface RemoteOrderInfoService {

    /**
     * 获取未完成订单
     */
    @GetMapping("/orderInfoApi/getNoFinishOrder/{userId}")
    public R<OrderInfo> getNoFinishOrder(@PathVariable("userId") Long userId);



    /** 根据订单号获取订单信息*/
    @GetMapping("/orderInfoApi/getByOrderNo/{orderNo}")
    public R<OrderInfo> getByOrderNo(@PathVariable("orderNo") String orderNo);
}